package com.itheima.controller;

import com.itheima.pojo.Attendance;
import com.itheima.pojo.PageBean;
import com.itheima.pojo.Result;
import com.itheima.pojo.WeeklyReport;
import com.itheima.service.WeeklReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/weeklyreport")
@Validated
public class WeeklyreportController {
    @Autowired
    private WeeklReportService weeklReportService;
    @GetMapping
    public Result<PageBean<WeeklyReport>> list(
            Integer pageNum,
            Integer pageSize
    ) {
        PageBean<WeeklyReport> pb = weeklReportService.getWeeklyReportsForMember(pageNum, pageSize);
        return Result.success(pb);
    }
}
